<?php $file    = explode(".",basename($_SERVER["SCRIPT_NAME"])); ?>
<div id="sidebar"><div id="sidebar-wrapper"> <!-- Sidebar with logo and menu -->
			
			<h1 id="sidebar-title"><a href="#">Simpla Admin</a></h1>
		  
			<!-- Logo (221px wide) -->
			<a href="#"><img id="logo" width='220px' style="display: none;" src="images/logo.png" alt="Simpla Admin logo" /></a>
			<br />
			<br />
		  
			<!-- Sidebar Profile links -->
			<div id="profile-links">
				Bem Vindo, <a href="#" title="Editar seu usuário."><?php echo $_SESSION["usuario"]["nome"]; ?></a>.
				<a href="tarefas.php" title="View the Site">Tarefas</a> | <a href="<?php echo BASE; ?>/sair.php" title="Sign Out">Sair</a>
			</div>        

			<ul id="main-nav">  <!-- Accordion Menu -->
				<?php foreach(Menu::get() as $k => $v): ?>
				<li>
					<a href="<?php echo (is_array($v))?'#':$k.".php"; ?>" 
					class="nav-top-item <?php echo (is_array($v))?'':"no-submenu"; ?> <?php echo ($k==$file[0]||array_key_exists($file[0],$v))?'current':""; ?>"> 
						<?php echo ucwords(is_array($v)?$k:$v); ?>
					</a>
					
					<?php if(is_array($v)): ?>
					
					<ul>
						<?php foreach($v as $ksub => $sub): ?>
						<li>
							<a class="<?php echo ($ksub==$file[0])?'current':""; ?>" href="<?php echo $ksub; ?>.php">
								<?php echo $sub; ?>
							</a>
						</li>
						<?php endforeach; ?>
					</ul>
					
					<?php endif; ?>
					
				</li>
				<?php endforeach; ?>
				
			</ul> <!-- End #main-nav -->
			
		</div></div> <!-- End #sidebar -->